package cn.zhiquxing;

import org.junit.jupiter.api.Test;

public class ReorderDemo {
    
    private volatile int x = 0;
    
    private Boolean flag = false;
    
    public void update() {
        x = 8;
        flag = true;
    }
    @Test
    public void test() {
        System.out.println(flag);
        if (flag) {
            System.out.println(x);
        }
    }
}
